package com.et.ball.view
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	import com.et.ball.module.StyleButton;

	public class MenuLayer extends View 
	{
		private var _game:Game;
		
		 
		private var playBtn:StyleButton;
	 
		//声明游戏名称等文本；
		private var gameName:TextField;		 
	  
		public function MenuLayer(game:Game)
		{
			_game=game;
			super()
		}
 
		override public function init():void
		{
			//设置游戏名字文本；
			gameName=new TextField();
			gameName.text="男人的决斗";
			gameName.textColor=0xff0000;
			gameName.width=250;
			gameName.height=200;
			var format1:TextFormat=new TextFormat();
			format1.align=TextFormatAlign.CENTER;
			format1.bold=true;
			format1.size=30;
			gameName.setTextFormat(format1);
			gameName.x=(_game.stage.stageWidth-gameName.width)/2;
			gameName.y=120;
			addChild(gameName);
			
			//添加选择按钮；
			playBtn=new StyleButton(100,40,"Play");
			 
			playBtn.x=(_game.stage.stageWidth-playBtn.width)/2;
			playBtn.y=350;
			 
			addChild(playBtn);
			playBtn.addEventListener(MouseEvent.CLICK,playHandler);
		 
		}
		private function playHandler(e:MouseEvent):void{
			this.dispatchEvent(new Event("play"));
		}
		
		override public function setData():void
		{
			
		}
	}
}